package org.lc.gateway.execption;

import lombok.Getter;
import org.lc.platform.base.enums.AuthResultEnum;
import org.lc.platform.base.enums.ResultCodeEnum;
import org.springframework.security.core.AuthenticationException;

@Getter
public class CustomAuthException extends AuthenticationException {
    private int code = ResultCodeEnum.FAILED.code;
    private String msg = ResultCodeEnum.FAILED.msg;

    public CustomAuthException(AuthResultEnum auth) {
        this(auth.getMsg(), auth.getCode());
    }

    public CustomAuthException(ResultCodeEnum auth) {
        this(auth.getMsg(), auth.getCode());
    }

    public CustomAuthException(String msg, int code) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public CustomAuthException(String msg) {
        super(msg);
        this.msg = msg;
    }
}
